function CombiColumnChart(chartDiv,title,xaxisName,yaxisName,categoryMap,dataMap){
	this.chartDiv=chartDiv;
	this.title=title;
	this.xaxisName=xaxisName;
	this.yaxisName=yaxisName;
	this.dataMap=dataMap;
	this.seriesNameA ="";
	this.seriesNameB="";
	this.categoryMap=categoryMap;
	this.toCompare = false;
	this.toCompareServer = false;
	this.compareDataMap={};
	this.serverTypes={};
	this.numberSuffix="";
};CombiColumnChart.prototype.setCompareDateMap = function(compareDataMap){
	this.compareDataMap=compareDataMap;
	this.toCompare = true;
};

CombiColumnChart.prototype.setNumberSuffix = function(numberSuffix){
	this.numberSuffix=numberSuffix;
};

CombiColumnChart.prototype.setServerTypes = function(serverTypes){
	this.serverTypes=serverTypes;
	this.toCompareServer= true;
};

CombiColumnChart.prototype.setSeriesName = function(seriesNameA,seriesNameB){
	this.seriesNameA=seriesNameA;
	this.seriesNameB=seriesNameB;
};

CombiColumnChart.prototype.generateDataString = function(){
	this.chartString ="<chart caption='"+this.title+"' xaxisname='"+this.xaxisName+"' yAxisName='"+this.yaxisName+"' baseFontSize='12' showValues='0' numberSuffix='"+this.numberSuffix+"' formatNumber='0' formatNumberScale='0' palette='3'>";
	this.chartString +="<categories>";
	for(var i in this.categoryMap){
		this.chartString +="<category label='"+this.categoryMap[i]+"'/>";
	}
	this.chartString +="</categories>";
    if(this.toCompareServer){
    	for(var i in this.serverTypes){
    		var seriesName=$("#server_name_"+serverTypes[i]).text();
			this.chartString +="<dataset seriesName='"+seriesName+"'>";
    		for(var j in this.categoryMap){
				var type;
				type=this.categoryMap[j]+"_"+serverTypes[i];	
				var value = this.dataMap[type];
				if (value === undefined){
				value = 0;
				}
		    this.chartString +="<set value='"+value+"' />";
		
    	}
    		this.chartString +="</dataset>";
      }
    }else{
    	this.chartString +="<dataset seriesName='"+this.seriesNameA+"'>";
    	for(var i in this.categoryMap){
    		var type = this.categoryMap[i];
    		var value = this.dataMap[type];
    		if (value === undefined){
    			value = 0;
    	    }
    		this.chartString +="<set value='"+value+"' />";
    	}
    	this.chartString +="</dataset>";
    }

	if(this.toCompare){
		this.chartString +="<dataset seriesName='"+this.seriesNameB+"'>";
		for(var i in this.categoryMap){
    		var type = this.categoryMap[i];
    		var value = this.compareDataMap[type];
    		if (value === undefined){
    			value = 0;
    	    }
    		this.chartString +="<set value='"+value+"' />";
    	}
		this.chartString +="</dataset>";
	}
	this.chartString +="</chart>";
	//alert(this.chartString);
};
CombiColumnChart.prototype.draw = function(){
	this.generateDataString();
	var chart = new FusionCharts("../static/FusionCharts/MSColumn2D.swf", "ChartId", "726", "325", "0", "0");
    chart.setXMLData(this.chartString);
    chart.render(this.chartDiv);
};